<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/statics/css/sapar.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/statics/css/common.css" />
<script type="text/javascript"
	src="${pageContext.request.contextPath }/statics/js/jquery.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/statics/js/sapar.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/statics/js/WdatePicker.js"></script>
<script type="text/javascript"
	src='${pageContext.request.contextPath }/statics/js/jquery-1.12.4.js'></script>
<script type="text/javascript">
	$(function() {
		$("#updatePwd").submit(function() {
			var pwd = $("#oldPwd").val();
			var newpwd = $("#newPwd").val();
			var againpwd = $("#againPwd").val();
			var password = '${user.user_password}';
			if (pwd == null || pwd == '') {
				alert("原密码不能为空");
				return false;
			} else if (pwd != password) {
				alert("原密码输入错误！");
				return false;
			} else if (newpwd == null || newpwd == '') {
				alert("新密码不能为空");
				return false;
			} else if (newpwd == null || newpwd == '') {
				alert("新密码不能为空");
				return false;
			} else if (againpwd == null || againpwd == '') {
				alert("确认密码不能为空");
				return false;
			} else if (newpwd != againpwd) {
				alert("两次输入的密码不一样");
				return false;
			}
			alert("修改密码成功！");
			return true;
		});
	});
</script>
<title>系统首页</title>
</head>
<body>
	<div id="saper-container">
		<div id="saper-hd"></div>
		<div id="saper-bd">
			<div class="subfiled clearfix">
				<h2>修改密码</h2>
			</div>
			<div class="subfiled-content">
				<form class="saper-form"
					action="${pageContext.request.contextPath }/updatePwd.do"
					method="post" id="updatePwd">
					<input type="hidden" name="user_id" value="${user.user_id}" id="user_id" />
					<div class="kv-item clearfix">
						<label>用户名：</label>
						<div class="kv-item-content">
							<div class="user-name" style="line-height: 30px;">${user.user_name}</div>
						</div>
					</div>
					<div class="kv-item clearfix">
						<label><span class="impInfo">*</span>原密码：</label>
						<div class="kv-item-content">
							<input type="password" placeholder="原密码" id="oldPwd" />
						</div>
					</div>
					<div class="kv-item clearfix">
						<label><span class="impInfo">*</span>新密码：</label>
						<div class="kv-item-content">
							<input type="password" placeholder="新密码" name="user_password"
								id="newPwd" />
						</div>
					</div>
					<div class="kv-item clearfix">
						<label><span class="impInfo">*</span>确认密码：</label>
						<div class="kv-item-content">
							<input type="password" placeholder="确认密码" name="againPwd"
								id="againPwd" />
						</div>
					</div>

					<div class="buttons">
						<!-- <a href="javascript:;" class="sapar-btn sapar-btn-recom">确定</a> -->
						<input type="submit" value="修改" class="sapar-btn sapar-btn-recom" />
					</div>
				</form>
				<div>
					<span id="error"></span>
				</div>
			</div>
		</div>
		<div id="saper-ft"></div>
	</div>
</body>
</html>